package com.huangwenshuo.futurestarschoolmanagement.utils;


import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTimeUtils {

    /**
     * 获取时间字符串
     * @param format 格式（yyyy-MM-dd）
     * @return
     */
    public static String getDateStr(String format){
        Date now = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(now);
    }

    public static String getDateStrByString(Date data , String format){
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(data);
    }

}